package com.zttek.photosShareProject.modules.service.share;

import com.baomidou.mybatisplus.plugins.Page;
import com.zttek.photosShareProject.common.json.InfoVO;
import com.zttek.photosShareProject.common.myException.DBException;
import com.zttek.photosShareProject.modules.model.Info;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Y
 * Date: 2017-08-19
 * Time: 10:37
 */
public interface IInfoService {

    String COMMENT_REPLY = "你的评论被回复";
    String SHARE_REPLY = "你的分享被评论";
    String SHARE_PRAISE = "你的分享被赞";

    int SHARE = 1;
    int COMMENT = 2;

    int NOTICE = 0;

    int PRAISE = 1;
    int COLLECT = 2;
    int STAR = 3;
    int REPLY = 4;
    int AT = 5;

    /**
     * 生成对分享的系统通知
     * @param toUserId *
     * @param shareId *
     * @param content *
     * @return *
     */
    Info createSystemInfoForShare(Long toUserId, Long shareId, String content) throws Exception;

    /**
     * 生成对评论的系统通知
     * @param toUserId *
     * @param commentId *
     * @param content *
     * @return *
     */
    Info createSystemInfoForComment(Long toUserId, Long commentId, String content) throws Exception;

    /**
     * 生成无对象的系统通知
     * @param toUserId *
     * @param content *
     */
    Info createSystemInfoForNotice(Long toUserId, String content) throws Exception;

    /**
     * 生成对分享的用户通知
     * @param toUserId *
     * @param shareId *
     * @param interact 互动方式
     * @return *
     */
    Info createUserInfoForShare(Long toUserId, Long fromUserId, Long shareId, Integer interact) throws Exception;

    /**
     * 生成对评论的用户通知
     * @param toUserId *
     * @param commentId *
     * @param interact 互动方式
     * @return *
     */
    Info createUserInfoForComment(Long toUserId, Long fromUserId, Long commentId, Integer interact) throws Exception;

    /**
     * 生成无对象的用户通知
     * @param toUserId *
     * @param interact 互动方式
     * @return *
     */
    Info createUserInfoForNotice(Long toUserId, Long fromUserId, Integer interact) throws Exception;

    /**
     *
     * @param userId *
     * @return *
     */
    public Integer countNewInfo(Long userId) throws Exception;

    /**
     * 查询用户消息
     * @param page *
     * @param userId *
     * @return *
     */
    Page<Info> selectInfo(Page<Info> page, Long userId, Integer range) throws Exception;

    /**
     * 分页查询所有系统通知
     * @param page *
     * @return *
     */
    Page<Info> selectAllSystemInfo(Page<Info> page)throws Exception;

    /**
     * 已阅读消息
     * @param infoIds *
     */
    void read(List<Long> infoIds) throws Exception;

    /**
     * 删除消息
     * @param infoId *
     */
    void deleteInfo(Long infoId) throws Exception;

    InfoVO info2VO(Info info) throws Exception;

    List<InfoVO> info2VO(List<Info> infos) throws Exception;
}
